import App from '../App'

const home = r => require.ensure([], () => r(require('../page/home/home')), 'home')
const city = r => require.ensure([], () => r(require('../page/city/city')), 'city')
const msite = r => require.ensure([], () => r(require('../page/msite/msite')), 'msite')

const shop = r => require.ensure([], () => r(require('../page/shop/shop')), 'shop')
const shop1 = r => require.ensure([], () => r(require('../page/shop1/shop1')), 'shop1')
const login = r => require.ensure([], () => r(require('../page/login/login')), 'login')
const profile = r => require.ensure([], () => r(require('../page/profile/profile')), 'profile')
const forget = r => require.ensure([], () => r(require('../page/forget/forget')), 'forget')
const order = r => require.ensure([], () => r(require('../page/order/order')), 'order')
const orderDetail = r => require.ensure([], () => r(require('../page/order/children/orderDetail')), 'orderDetail')
const vipcard = r => require.ensure([], () => r(require('../page/vipcard/vipcard')), 'vipcard')
const invoiceRecord = r => require.ensure([], () => r(require('../page/vipcard/children/invoiceRecord')), 'invoiceRecord')
const useCart = r => require.ensure([], () => r(require('../page/vipcard/children/useCart')), 'useCart')
const vipDescription = r => require.ensure([], () => r(require('../page/vipcard/children/vipDescription')), 'vipDescription')
const food = r => require.ensure([], () => r(require('../page/food/food')), 'food')
const foods= r => require.ensure([], () => r(require('../page/foods/foods')), 'foods')
const confirmOrder = r => require.ensure([], () => r(require('../page/confirmOrder/confirmOrder')), 'confirmOrder')
const confirmOrder1 = r => require.ensure([], () => r(require('../page/confirmOrder1/confirmOrder1')), 'confirmOrder1')
const remark = r => require.ensure([], () => r(require('../page/confirmOrder/children/remark')), 'remark')
const remark1 = r => require.ensure([], () => r(require('../page/confirmOrder1/children/remark1')), 'remark1')
const payment = r => require.ensure([], () => r(require('../page/confirmOrder/children/payment')), 'payment')
const payment1 = r => require.ensure([], () => r(require('../page/confirmOrder1/children/payment1')), 'payment1')
const userValidation = r => require.ensure([], () => r(require('../page/confirmOrder/children/userValidation')), 'userValidation')
const userValidation1 = r => require.ensure([], () => r(require('../page/confirmOrder1/children/userValidation1')), 'userValidation1')
const invoice = r => require.ensure([], () => r(require('../page/confirmOrder/children/invoice')), 'invoice')
const invoice1 = r => require.ensure([], () => r(require('../page/confirmOrder1/children/invoice1')), 'invoice1')
const chooseAddress = r => require.ensure([], () => r(require('../page/confirmOrder/children/chooseAddress')), 'chooseAddress')
const chooseAddress1 = r => require.ensure([], () => r(require('../page/confirmOrder1/children/chooseAddress1')), 'chooseAddress1')
const addAddress = r => require.ensure([], () => r(require('../page/confirmOrder/children/children/addAddress')), 'addAddress')
const addAddress1 = r => require.ensure([], () => r(require('../page/confirmOrder1/children/children/addAddress1')), 'addAddress1')
const searchAddress = r => require.ensure([], () => r(require('../page/confirmOrder/children/children/children/searchAddress')), 'searchAddress')
const searchAddress1 = r => require.ensure([], () => r(require('../page/confirmOrder1/children/children/children/searchAddress1')), 'searchAddress1')
const foodDetail = r => require.ensure([], () => r(require('../page/shop/children/foodDetail')), 'foodDetail')
const foodDetail1 = r => require.ensure([], () => r(require('../page/shop1/children/foodDetail1')), 'foodDetail1')
const shopDetail = r => require.ensure([], () => r(require('../page/shop/children/shopDetail')), 'shopDetail')
const shopDetail1 = r => require.ensure([], () => r(require('../page/shop1/children/shopDetail1')), 'shopDetail1')
const shopSafe = r => require.ensure([], () => r(require('../page/shop/children/children/shopSafe')), 'shopSafe')
const shopSafe1 = r => require.ensure([], () => r(require('../page/shop1/children/children/shopSafe1')), 'shopSafe1')
const info = r => require.ensure([], () => r(require('../page/profile/children/info')), 'info')
const setusername = r => require.ensure([], () => r(require('../page/profile/children/children/setusername')), 'setusername')
const address = r => require.ensure([], () => r(require('../page/profile/children/children/address')), 'address')
const add = r => require.ensure([], () => r(require('../page/profile/children/children/children/add')), 'add')
const addDetail = r => require.ensure([], () => r(require('../page/profile/children/children/children/children/addDetail')), 'addDetail')
const balance = r => require.ensure([], () => r(require('../page/balance/balance')), 'balance')
const balanceDetail = r => require.ensure([], () => r(require('../page/balance/children/detail')), 'balanceDetail')
const benefit = r => require.ensure([], () => r(require('../page/benefit/benefit')), 'benefit')
const coupon = r => require.ensure([], () => r(require('../page/benefit/children/coupon')), 'coupon')
const hbDescription = r => require.ensure([], () => r(require('../page/benefit/children/hbDescription')), 'hbDescription')
const hbHistory = r => require.ensure([], () => r(require('../page/benefit/children/hbHistory')), 'hbHistory')
const exchange = r => require.ensure([], () => r(require('../page/benefit/children/exchange')), 'exchange')
const commend = r => require.ensure([], () => r(require('../page/benefit/children/commend')), 'commend')
const points = r => require.ensure([], () => r(require('../page/points/points')), 'points')
const pointsDetail = r => require.ensure([], () => r(require('../page/points/children/detail')), 'pointsDetail')
const service = r => require.ensure([], () => r(require('../page/service/service')), 'service')
const questionDetail = r => require.ensure([], () => r(require('../page/service/children/questionDetail')), 'questionDetail')
const find = r => require.ensure([], () => r(require('../page/find/find')), 'find')
const download = r => require.ensure([], () => r(require('../page/download/download')), 'download')



//个人中心投诉与建议组件路由
const complaint = r =>require.ensure([],() => r(require('../page/complaint/complaint')),'complaint')
const complaints = r =>require.ensure([],() => r(require('../page/complaint/complaints/complaints')),'complaints')
const suggest = r =>require.ensure([],() => r(require('../page/complaint/suggest/suggest')),'suggest')
//我的订单路由
const myorders = r =>require.ensure([],() => r(require('../page/myOrders/myorders')),'myorders')
//我的交易路由
const myshop = r =>require.ensure([],() => r(require('../page/myShop/myshop')),'myshop')
//我的购买
const mybuy = r =>require.ensure([],() => r(require('../page/mybuy/mybuy')),'mybuy')


// 活动中心路由
const active = r => require.ensure([], () => r(require('../page/active/active')), 'active')
const comactive = r => require.ensure([], () => r(require('../page/active/headto/comactive/comactive')), 'comactive')
const myactive = r => require.ensure([], () => r(require('../page/active/headto/myactive/myactive')), 'myactive')
// 活动详情页
const activeDetail = r => require.ensure([], () => r(require('../page/active/activeDetail/activeDetail')), 'activeDetail')
// 添加活动
const addActive = r => require.ensure([], () => r(require('../page/active/addActive/addActive')), 'addActive')
// 评论活动
const addcomm = r => require.ensure([], () => r(require('../page/active/addcomm/addcomm')), 'addcomm')


const addComplaint= r=>require.ensure([],() => r(require('../page/complaint/complaints/children/addComplaint')),'addComplaint')
const addSuggest= r=>require.ensure([],() => r(require('../page/complaint/suggest/children/addSuggest')),'addSuggest')
// 二手交易
const secondHeadPage= r=>require.ensure([],() => r(require('../page/secondHandArea/secondHead')),'secondHeadPage')

//二手货物详情展示页
const goodshow= r=>require.ensure([],() => r(require('../page/secondHandArea/headpage/goodshow')),'goodshow')

const addmessage= r=>require.ensure([],() => r(require('../page/message/addMessage')),'addmessage')

const addgoods= r=>require.ensure([],() => r(require('../page/secondHandArea/headpage/addgoods')),'addgoods')

const selectgoods= r=>require.ensure([],() => r(require('../page/secondHandArea/headpage/selectgoods')),'selectgoods')
//动态展示
const search = r => require.ensure([], () => r(require('../page/search/search')), 'search')
//动态添加
const dynamicAdd = r => require.ensure([], () => r(require('../page/search/dynamicAdd')), 'dynamicAdd')
//动态详情
const dynamicDetail = r => require.ensure([], () => r(require('../page/search/dynamicDetail')), 'dynamicDetail')
//动态管理
const dynamicManage = r => require.ensure([], () => r(require('../page/search/dynamicManage')), 'dynamicManage')
//评论添加
const commentAdd = r => require.ensure([], () => r(require('../page/search/commentAdd')), 'commentAdd')
//房屋审核
const house = r => require.ensure([], () => r(require('../page/house/house')), 'house')



export default [{
    path: '/',
    component: App, //顶层路由，对应index.html
    children: [ //二级路由。对应App.vue
        //地址为空时跳转home页面
        {
            path: '/suibianxuan', // 初始为空，地址空
            redirect: '/home'
        },
        //首页城市列表页
        {
            path: '/home',
            component: home
        },
        //当前选择城市页
        {
            path: '/city/:cityid',
            component: city
        },
        //所有商铺列表页
        {
            path: '',
            component: msite,
            meta: { keepAlive: true },
        },
        //特色商铺列表页
        {
            path: '/food',
            component: food
        },
         //特色商铺列表页
         {
            path: '/foods',
            component: foods
        },
        //搜索页
        {
            path: '/search',
            component: search
        },
        {
            path: '/dynamicDetail/:id', //帖子详情页
            component: dynamicDetail,

        },
        {
            path: '/house', //房屋绑定页
            component: house,

        },
        {
            path: '/commentAdd', //评论添加页
            component: commentAdd,

        },

        {
            path: '/dynamicManage', //动态管理页
            component: dynamicManage,

        },


        {
            path: '/dynamicAdd', //动态添加页
            component: dynamicAdd,

        },
        //商铺详情页
        {
            path: '/shop',
            component: shop,
            children: [{
                path: 'foodDetail', //食品详情页
                component: foodDetail,
            }, {
                path: 'shopDetail', //商铺详情页
                component: shopDetail,
                children: [{
                    path: 'shopSafe', //商铺安全认证页
                    component: shopSafe,
                }, ]
            }]
        },
         //商铺详情页
         {
            path: '/shop1',
            component: shop1,
            children: [{
                path: 'foodDetail1', //食品详情页
                component: foodDetail1,
            }, {
                path: 'shopDetail1', //商铺详情页
                component: shopDetail1,
                children: [{
                    path: 'shopSafe1', //商铺安全认证页
                    component: shopSafe1,
                }, ]
            }]
        },
        //确认订单页
        {
            path: '/confirmOrder',
            component: confirmOrder,
            children: [{
                path: 'remark', //订单备注
                component: remark,
            }, {
                path: 'invoice', //发票抬头
                component: invoice,
            }, {
                path: 'payment', //付款页面
                component: payment,
            }, {
                path: 'userValidation', //用户验证
                component: userValidation,
            }, {
                path: 'chooseAddress', //选择地址
                component: chooseAddress,
                children: [{
                    path: 'addAddress', //添加地址
                    component: addAddress,
                    children: [{
                        path: 'searchAddress', //搜索地址
                        component: searchAddress,
                    }]
                }, ]
            }, ]
        },
        //确认订单页
        {
            path: '/confirmOrder1',
            component: confirmOrder1,
            children: [{
                path: 'remark1', //订单备注
                component: remark1,
            }, {
                path: 'invoice1', //发票抬头
                component: invoice1,
            }, {
                path: 'payment1', //付款页面
                component: payment1,
            }, {
                path: 'userValidation1', //用户验证
                component: userValidation1,
            }, {
                path: 'chooseAddress1', //选择地址
                component: chooseAddress1,
                children: [{
                    path: 'addAddress1', //添加地址
                    component: addAddress1,
                    children: [{
                        path: 'searchAddress1', //搜索地址
                        component: searchAddress1,
                    }]
                }, ]
            }, ]
        },
        //登录注册页
        {
            path: '/login',
            component: login

        },
        //个人信息页
        {
            path: '/profile',
            component: profile,
            children: [{
                path: 'info', //个人信息详情页
                component: info,
                children: [{
                    path: 'setusername',
                    component: setusername,
                },{
                    path: 'address',
                    component: address,     //编辑地址
                    children:[{
                        path:'add',
                        component:add,
                        children:[{
                            path:'addDetail',
                            component:addDetail
                        }]
                    }]
                }]
            },
            {
                path: 'service', //服务中心
                component: service,
            },]
        },
        //修改密码页
        {
            path: '/forget',
            component: forget
        },
        //订单列表页
        {
            path: '/order',
            component: order,
            children: [{
                path: 'orderDetail', //订单详情页
                component: orderDetail,
            }, ]
        },
        //活动页
        {
            path: '/active',
            component: active,
            children: [
                {
                    path: 'comactive',// 社区活动
                    component: comactive,
                },
                {
                    path: 'myactive', // 我的活动
                    component: myactive 
                }
                 
            ]
        },

         //二手交易市场
         {
            path: '/secondHeadPage',
            component: secondHeadPage,
            children: [
             ]
        },
        //二手交易信息详情
        {
            path: 'goodshow',
            component: goodshow,
            children: [

             ]
        },
        // 查询商品信息
        {
            path: '/selectgoods',
            component: selectgoods,
            children: [

             ]
        },
         //添加留言信息路由
         {
            path: '/addmessage',
            component: addmessage,
            children: [

             ]
        },
         //添加商品信息
         {
            path: '/addgoods',
            component: addgoods,
            children: [

             ]
        },
        //vip卡页
        {
            path: '/vipcard',
            component: vipcard,
            children: [{
                path: 'invoiceRecord', //开发票
                component: invoiceRecord,
            }, {
                path: 'useCart', //购买会员卡
                component: useCart,
            }, {
                path: 'vipDescription', //会员说明
                component: vipDescription,
            },]
        },
        //发现页
        {
            path: '/find',
            component: find
        },
        //下载页
        {
            path: '/download',
            component: download
        },
        //服务中心
        {
            path: '/service',
            component: service,
             children: [{
                path: 'questionDetail', //订单详情页
                component: questionDetail,
            }, ]
        },
        //余额
        {
            path: 'balance',
            component: balance,
            children: [{
                path: 'detail', //余额说明
                component: balanceDetail,
            }, ]
        },
        //我的优惠页
        {
            path: 'benefit',
            component: benefit,
            children: [{
                path: 'coupon', //代金券说明
                component: coupon,
            }, {
                path: 'hbDescription', //红包说明
                component: hbDescription,
            }, {
                path: 'hbHistory', //历史红包
                component: hbHistory,
            }, {
                path: 'exchange', //兑换红包
                component: exchange,
            }, {
                path: 'commend', //推荐有奖
                component: commend,
            },]
        },
        //我的积分页
        {
            path: 'points',
            component: points,
            children: [{
                path: 'detail', //积分说明
                component: pointsDetail,
            }, ]
        },
        //投诉与建议页
        {
            path: 'complaint',
            component: complaint,
            children: [{
                path: 'complaints', //投诉页
                component: complaints,
            }, 
            {
                path: 'suggest', //建议页
                component: suggest,
            }, ]
        },
        //我的订单
        {
            path: 'myorders',
            component: myorders, 
        },
         //我的交易
         {
            path: 'myshop',
            component: myshop, 
        },
         //我的购买
         {
            path: 'mybuy',
            component: mybuy, 
        },
       {
            path: 'addComplaint',
            component: addComplaint,
        },
        {
            path: 'addSuggest',
            component: addSuggest,
        }
    ]
}]
